#include "clkShape.h"

void clkRect::initRect(float a_width, float a_height)
{
	m_type = SHAPE_RECT;

	m_width = a_width;
	m_height = a_height;

	float hw = a_width/2.0f;
	float hh = a_height/2.0f;

	m_dir.set(1.0f,0.0f);
	m_dir *= a_width/2.0f;

	m_averts[0].set(-hw,-hh);
	m_averts[1].set(hw,-hh);
	m_averts[2].set(hw,hh);
	m_averts[3].set(-hw,hh);

	m_rverts[0].set(m_averts[0]);
	m_rverts[1].set(m_averts[1]);
	m_rverts[2].set(m_averts[2]);
	m_rverts[3].set(m_averts[3]);

	m_norms[0].set(0.0f,-1.0f);
	m_norms[1].set(1.0f,0.0f);
	m_norms[2].set(0.0f,1.0f);
	m_norms[3].set(-1.0f,0.0f);

	m_vertCount = VERT_MAX;
}